package com.kandinfo.base.admin.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.kandinfo.base.common.util.DateSerializer;

@MappedSuperclass
public class BaseDomain implements Serializable {

    private static final long serialVersionUID = 2210164548927669549L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    @Column(name = "create_by")
    private Long createBy;

    @Column(name = "update_by")
    private Long updateBy;

    @Column(name = "create_ts")
//    @Temporal(TemporalType.TIMESTAMP)
    private Date createTs;

    @Column(name = "update_ts")
//    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTs;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Date getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Date createTime) {
        this.createTs = createTime;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Date getUpdateTs() {
        return updateTs;
    }

    public void setUpdateTs(Date updateTs) {
        this.updateTs = updateTs;
    }

}
